<!--
  ~ This program is part of the OpenLMIS logistics management information system platform software.
  ~ Copyright © 2013 VillageReach
  ~
  ~ This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
  ~  
  ~ This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more details.
  ~ You should have received a copy of the GNU Affero General Public License along with this program.  If not, see http://www.gnu.org/licenses.  For additional information contact info@OpenLMIS.org. 
  -->

<h2 id="viewOrderHeader" openlmis-message="link.orders.view"></h2>

<div class="app-form">
  <div class="row-fluid">
  <div class="pull-right">

    <div class="pull-left">
      <label for="program" openlmis-message="label.program"> <span class="label-required"> *</span></label>
      <select id="program" ng-change="OnProgramChanged();OnFilterChanged()" ng-model="program">
        <option ng-repeat="line in programs" value="{{line.id}}">{{line.name}}</option>
      </select>
    </div>
      
    <div class="pull-left">
      <label for="schedule" openlmis-message="label.schedule"> <span class="label-required"> *</span></label>
      <select id="schedule" ng-change="LoadPeriods()" ng-model="schedule">
        <option ng-repeat="line in schedules" value="{{line.id}}">{{line.name}}</option>
      </select>
    </div>

    <div class="pull-left">
      <label for="year" openlmis-message="label.year"> <span class="label-required"> *</span></label>
      <select id="year" ng-change="LoadPeriods()" ng-model="year">
        <option ng-repeat="year in years" value="{{year}}">{{year}}</option>
      </select>
    </div>

    <div class="pull-left">
      <label for="period" openlmis-message="label.period"> <span class="label-required"> *</span></label>
      <select id="period" ng-change="OnFilterChanged()" ng-model="period">
        <option ng-repeat="line in periods" value="{{line.id}}">{{line.name}}</option>
      </select>
    </div>


   

    <div class="pull-left">
      <label for="depot" openlmis-message="label.supplying.depot"> <span class="label-required">*</span></label>
      <select id="depot" ng-change="OnFilterChanged()" ng-model="supplyDepot">
        <option ng-repeat="line in supplylines" value="{{line.id}}">{{line.name}}</option>
      </select>
    </div>
  </div>
</div>
  <div class="clear-both"></div>
    <div class="form-group">
        <h3 ng-show="orders != undefined" openlmis-message="label.order.list"></h3>
      <div id="noFilterSelected" ng-show="orders == undefined" >
        <span>Please select value in all required filters above</span>
      </div>
        <div class="alert alert-info" id="noOrdersPresent" ng-show="orders != undefined && orders.length == 0" >
            <span openlmis-message="message.no.order"></span>
        </div>
        <div class="alert alert-info" id="noOrders" ng-show="downloadMessage" openlmis-message="downloadMessage">
        </div>
        <div ng-show="orders && orders.length" id="ordersGrid" class="gridStyle" ng-grid="gridOptions"></div>
        <div ng-show="orders && orders.length">
            <openlmis-pagination num-pages="numberOfPages" current-page="currentPage"
                                 max-size="10"></openlmis-pagination>
        </div>
    </div>
</div>

